#pragma once
#ifndef SHORTCUTTABLE_H
#define SHORTCUTTABLE_H

#include "spa_types.h"
#include <map>

using namespace std;

class ShortcutTable
{

public:

	ShortcutTable();
	~ShortcutTable();

	// Must check if statement number already exist.
	// Must check if constant value already exist.
	BOOLEAN InsertAssign(const INTEGER statement_number);
	BOOLEAN InsertCall(const INTEGER statement_number);
	BOOLEAN InsertIf(const INTEGER statement_number);
	BOOLEAN InsertWhile(const INTEGER statement_number);
	BOOLEAN InsertConstant(const INTEGER constant_value);
	
	// Variables: Use VarTable's GetAllVarNames()
	// Procedures: Use ProcTable's GetAllProcNames()

	/*
	 Returns statement numbers containing the respective statement types.
	*/
	INTEGER_ARRAY GetAllProgramLine();
	INTEGER_ARRAY GetAllStatement();

	INTEGER_ARRAY GetAllAssign();
	INTEGER_ARRAY GetAllCall();
	INTEGER_ARRAY GetAllIf();
	INTEGER_ARRAY GetAllWhile();

	INTEGER_ARRAY GetAllConstant();

	NODETYPE GetStatementType(const INTEGER statement_number);

	// Returns count of each respective statement types.
	INTEGER GetIfCount();
	INTEGER GetCallCount();
	INTEGER GetWhileCount();
	INTEGER GetAssignCount();
	INTEGER GetConstantCount();
	INTEGER GetStatementCount();
	INTEGER GetProgramLineCount();

private:
	// Constants
	set<INTEGER> const_store;

	// Statements
	set<INTEGER> assign_store;
	set<INTEGER> call_store;
	set<INTEGER> if_store;
	set<INTEGER> while_store;

	map<INTEGER, NODETYPE> statement_store;
};

#endif